package com.newlink.building.common_base.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.newlink.building.common_base.event.MessageEvent
import com.newlink.building.common_base.event.TYPE_APP_RESEND_NOTIFY
import com.newlink.building.common_base.utils.NLog
import org.greenrobot.eventbus.EventBus

/**
 * @Author: Jake
 * @Date: 2024-08-05
 * @Description:
 */
class Base_LocaleChangeReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        if (intent?.action == Intent.ACTION_LOCALE_CHANGED) {
            NLog.e(" Fanvil link receive locale change action !!!")
            updateNotifications(context)
        }
    }

    private fun updateNotifications(context: Context?) {
        EventBus.getDefault().post(MessageEvent(TYPE_APP_RESEND_NOTIFY, 1))
    }
}